#ifndef PAINTITEM_H
#define PAINTITEM_H

#include "xict_ui_common/utils/utils.h"
#include <QImage>
#include <QQuickItem>
#include <QQuickWindow>
#include <QSGNode>
#include <QSGSimpleRectNode>
#include <QSGSimpleTextureNode>

class PaintItem : public QQuickItem {
    Q_OBJECT
    BJ_PROPERTY(int, cut_num)       // 屏幕总数
    BJ_PROPERTY(int, image_index)   // 图像编号
    BJ_PROPERTY(bool, top_screen)   // 是否为顶部屏幕
    BJ_PROPERTY(bool, revolve)      // 是否旋转
public:
    explicit PaintItem(QQuickItem* parent = nullptr);

public slots:
    void updateImage(const QImage& img, int state);

protected:
    QSGNode* updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*) override;

private:
    QImage m_image;
};

#endif   // PAINTITEM_H
